package org.supda.system.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TMessageSendId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class TMessageSendId implements java.io.Serializable {

	// Fields

	private Long userId;
	private Long messageId;

	// Constructors

	/** default constructor */
	public TMessageSendId() {
	}

	/** full constructor */
	public TMessageSendId(Long userId, Long messageId) {
		this.userId = userId;
		this.messageId = messageId;
	}

	// Property accessors

	@Column(name = "user_id", nullable = false)
	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	@Column(name = "message_id", nullable = false)
	public Long getMessageId() {
		return this.messageId;
	}

	public void setMessageId(Long messageId) {
		this.messageId = messageId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TMessageSendId))
			return false;
		TMessageSendId castOther = (TMessageSendId) other;

		return ((this.getUserId() == castOther.getUserId()) || (this
				.getUserId() != null && castOther.getUserId() != null && this
				.getUserId().equals(castOther.getUserId())))
				&& ((this.getMessageId() == castOther.getMessageId()) || (this
						.getMessageId() != null
						&& castOther.getMessageId() != null && this
						.getMessageId().equals(castOther.getMessageId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUserId() == null ? 0 : this.getUserId().hashCode());
		result = 37 * result
				+ (getMessageId() == null ? 0 : this.getMessageId().hashCode());
		return result;
	}

}